﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Apps.Model.Base;

namespace Apps.Model.Models
{
    /// <summary>
    /// 菜单
    /// </summary>
    [Table("Sys_Menu")]
    [Description("系统菜单")]
    public class SysMenu : SysBase, IEntity<int>
    {
        /// <summary>
        /// 主键
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        /// <summary>
        /// 菜单名称
        /// </summary>
        [Required]
        [StringLength(50)]
        [Description("菜单名称")]
        public string MenuName { get; set; }

        /// <summary>
        /// 菜单编码
        /// </summary>
        [Required]
        [StringLength(50)]
        [Description("菜单编码")]
        public virtual string MenuCode { get; set; }

        /// <summary>
        /// 父菜单ID
        /// </summary>
        [Description("父菜单ID")]
        public int ParentId { get; set; } = 0;

        /// <summary>
        /// 	路由地址
        /// </summary>
        [Required]
        [StringLength(200)]
        public string Path { get; set; } = "";

        /// <summary>
        /// 是否为外链（1是 0否）
        /// </summary>
        public int IsFrame { get; set; } = 0;


        /// <summary>
        /// 菜单权限字符
        /// </summary>
        [Description("菜单权限字符")]
        public string Perms { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        [StringLength(256)]
        [Description("图标")]
        public string Icon { get; set; } = string.Empty;

        /// <summary>
        /// 菜单类型（M目录 C菜单 F按钮 L链接）
        /// </summary>
        [Description("菜单类型（M目录 C菜单 F按钮 L链接）")]
        public string MenuType { get; set; } = string.Empty;
        /// <summary>
        /// 排序
        /// </summary>
        [Description("排序")]
        public int Sort { get; set; }

        /// <summary>
        /// 菜单状态（0显示 1隐藏）
        /// </summary>
        public int IsEnable { get; set; } = 0;

        /// <summary>
        /// 是否删除（0未删除, 1删除）
        /// </summary>
        public int IsDeleted { get; set; }



        /// <summary>
        /// 是否缓存（1不缓存 0缓存）
        /// </summary>
        [Description("是否缓存（1不缓存 0缓存）")]
        public string IsCache { get; set; } = "0";


    }
}